const { sequelize } = require("../../core/db");
const { Sequelize, Model } = require("sequelize");

class Favor extends Model {}

Favor.init(
  {
    favor_id: {
      type: Sequelize.INTEGER,
      primaryKey: true,
      autoIncrement: true,
    },
    news_id: {
      type: Sequelize.STRING,
      allowNull: false,
    },
    uid: Sequelize.INTEGER,
  },
  {
    sequelize,
    tableName: "favor",
    hooks: {
      afterCreate: async (favor, option) => {},
      afterUpdate: async (favor, option) => {},
      afterDestroy: async (favor, option) => {},
    },
  }
);

module.exports = {
  Favor,
};
